﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="FisheryPlatform.Web.WWW.Product.Index" %>

<%@ Import Namespace="FisheryPlatform.Bussiness.Cache" %>
<%@ Register TagName="Style" TagPrefix="Menu" Src="~/Modules/Menu/StyleMenu.ascx" %>
<%@ Register TagName="PageBar" TagPrefix="ucPB" Src="~/Modules/PageBar.ascx" %>
<%@ Register TagName="ShareCode" TagPrefix="pl" Src="~/Modules/Layer/PopupLayer.ascx" %>
<%@ Register TagName="SimpleHeader" TagPrefix="Menu" Src="~/Modules/Menu/SimpleHeader.ascx" %>
<%@ Register TagName="Footer" TagPrefix="Menu" Src="~/Modules/Menu/FooterMenu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <Menu:Style runat="server" ID="menuStyle" Title=""></Menu:Style>
    <script type="text/javascript" src="<%=FisheryPlatform.SiteConfig.SiteConfigManager.WebSite.JS%>/Pub/20110725/calendar.js"></script>
    <script type="text/javascript" src="<%=FisheryPlatform.SiteConfig.SiteConfigManager.WebSite.JS%>/Pub/20110725/PagePromptBox.js"></script>
    <script type="text/javascript" src="<%=FisheryPlatform.SiteConfig.SiteConfigManager.WebSite.JS%>/Pub/20110725/PopupLayer.js"></script>
</head>
<body>
    <div class="wrapper">
        <Menu:SimpleHeader runat="server" ID="menuSimpleHeader" />
        <form id="form1" runat="server">
        <div class="content">
            <div class="choose">
                <p>
                    <span class="lb">供需：</span> <span class="lb_cont">
                        <input type="radio" id="rd_All" onclick="PageChanged(1)" name="type" /><label for="rd_All">不限</label><input
                            type="radio" id="rd_Sell" onclick="PageChanged(1)" name="type" /><label for="rd_Sell">出售</label><input
                                type="radio" id="rd_Buy" name="type" onclick="PageChanged(1)" /><label for="rd_Buy">求购</label>
                    </span>
                </p>
                <p>
                    <span class="lb">价格：</span> <span class="lb_cont"><a onclick="priceRange('0-0');return false;"
                        href="javascript:void(0)">不限</a>&nbsp;&nbsp;<a onclick="priceRange('0-3');return false;" href="javascript:void(0)">0-2元/斤</a>
                        |<a onclick="priceRange('3-6');return false;" href="javascript:void(0)">3-6元/斤</a>|<a onclick="priceRange('6-9');return false;"
                            href="javascript:void(0)">6-9元/斤</a> |<a onclick="priceRange('9-0');return false;" href="javascript:void(0)">9元以上/斤</a>
                        <input type="text" class="txt_border txt_input1" id="txt_MinPrice" value="<%=Request.QueryString["minPrice"] %>"
                            size="5" />-<input class="txt_border txt_input1" type="text" id="txt_MaxPrice" value="<%=Request.QueryString["maxPrice"] %>"
                                size="5" />元/斤 </span>
                </p>
                <p>
                    <span class="lb">地区：</span><span class="lb_cont"><pl:ShareCode runat="server" ID="pl_Area"
                        DataType="Area" />
                    </span>
                </p>
                <p>
                    <span class="lb">&nbsp;</span><span><input type="button" value="搜索" id="btnSearch" /></span></p>
            </div>
            <div class="left">
                <% 
                    foreach (var item in ProList)
                    {
                %>
                <p>
                    <a href="<%=ProductStaticHtmlCache.GetFileName(item.ProductId.ToString(),item.CreateDate)%>"
                        target="_blank">
                        <%=item.Title %></a> <span>
                            <%=HttpUtility.HtmlEncode(FisheryPlatform.Bussiness.ShareCode.ShareCodeManager.GetShareCodeById(item.CategoryId).Name)%></span>
                    <span>-
                        <%=HttpUtility.HtmlEncode(FisheryPlatform.Bussiness.ShareCode.ShareCodeManager.GetShareCodeById(item.AreaId).Name)%></span>
                    <span>
                        <%= item.CreateDate %></span>
                </p>
                <%} %>
                <div>
                    <ucPB:PageBar runat="server" ID="pb_PageBar" />
                </div>
            </div>
            <div class="right">
                <div class='col'>
                    <ul>
                        <li><a href="#">afadfadf</a></li>
                    </ul>
                </div>
            </div>
        </div>
        </form>
        <Menu:Footer runat="server" ID="menuFooter" />
    </div>
</body>
</html>
<script type="text/javascript">
    switch ('<%=Request.QueryString["t"] %>') {
        case '2': jDoc("rd_Buy").checked = true; break;
        case '1': jDoc("rd_Sell").checked = true; break;
        default: jDoc("rd_All").checked = true; break;
    }
</script>
<script type="text/javascript">
    function PageChanged(pageIndex) {
        var params = [];
        //params.push("title=" + encodeURIComponent(jDoc("txt_Title").value));
        if (jDoc("rd_Buy").checked) {
            params.push("t=2");
        } else if (jDoc("rd_Sell").checked) {
            params.push("t=1");
        }
        params.push("pageIndex=" + pageIndex);
        params.push("minPrice=" + jDoc("txt_MinPrice").value);
        params.push("maxPrice=" + jDoc("txt_MaxPrice").value);
        params.push("areaid=" + jDoc("pl_Area_txt_SaveIds_pl").value);
        //alert(params.join("&"));
        var url = window.location.pathname + "?" + params.join("&");
        window.location.replace(url);
    }
    function priceRange(price) {
        var list = price.split('-');
        jDoc("txt_MinPrice").value = list[0];
        jDoc("txt_MaxPrice").value = list[1];
        PageChanged(1);
    }
    (function () {
        $(jDoc("btnSearch")).bind("click", function () {
            PageChanged(1);
        });
    })();
</script>
